import request from "@/utils/request";

// **管理员页面**
// 一级菜单 课程管理
// 二级菜单 已上架课程
// >get /course/getAdded  {des,course_name,teacher_id} list 获取上架课程
export function getAdded(data) {
  return request({
    url: '/course/getAdded',
    method: 'get',
    params:data
  })
}
export function getTeachList() {
  return request({
    url: '/teacher/getTeachList',
    method: 'get',
  })
}

// >post /course/UnAdded/courseId  下架
export function unAdded(courseId) {
  return request({
    url: '/course/unAdded/'+courseId,
    method: 'post',
  })
}
// >post /course/saveAdded {des,course_name,teacher,teach_type} 上架新增
export function saveAdded(item) {
  return request({
    url: '/course/saveAdded',
    method: 'post',
    data: item
  })
}
// 二级菜单 未上架课程
// >get /course/getUnAdded  {des,course_name,teacher} list  获取未上架课程
export function getUnAdded(data) {
  return request({
    url: '/course/getUnAdded',
    method: 'get',
    params:data
  })
}

// >post /course/Added/courseId  上架
export function added(courseId) {
  return request({
    url: '/course/added/'+courseId,
    method: 'post',
  })
}

// >post /course/saveUnAdded {des,course_name,teacher,teach_type} 下架架新增
export function saveUnAdded(item) {
  return request({
    url: '/course/saveUnAdded',
    method: 'post',
    data:item
  })
}
// 二级菜单 查看学生评价
// > get /student/getStudentRate
// > {[studentId,studentName ,sex,age,major ,avg]  list}
export function getStudentRate(data) {
  return request({
    url: '/student/getStudentRate',
    method: 'get',
    params:data
  })
}

// 二级菜单 查看教师评价
// > get /teacher/getTeacherRate
// > {[teacherName,,sex,age,,avg]  list}
export function getTeacherRate(data) {
  return request({
    url: '/teacher/getTeacherRate',
    method: 'get',
    params:data
  })
}
export function updateCourse(data) {
  return request({
    url: '/course',
    method: 'put',
    data:data
  })
}

